Skip to content

PL-0501: printable mat export + single-photo mat check (software only) - #117

Merged
Sekiph82 merged 5 commits into
mainfrom
feat/pl-0501-calibration-support
Dec 4, 2026
Merged

Sekiph82 merged 5 commits into
mainfrom
feat/pl-0501-calibration-support

Conversation

@Sekiph82

@Sekiph82 Sekiph82 commented Dec 3, 2026

Copy link
Copy Markdown
Owner

PL-0501 software calibration support

Inventory showed most of the path already existed (SVG A4/A3 mats v1.0.1, marker_detection, reconstruction_scale + scale_provenance with uncertainty, Studio "Scale from mat markers" with 100 mm bar print correction, check_printed_mat_spacing, PL-0068 benchmark record, PL-0221..0224 software halves). Missing pieces added here:

  • packlab_core.calibration.mat_photo_check: one photo -> detect four markers -> mat-mm to px homography fitted to all 16 corners -> corner residual (mm), mm/px at the mat centre, ruler print gate. CLI python -m packlab_core.calibration.mat_photo_check [PHOTO] [--export-mat PATH] [--mat a4|a3] [--spacing-x-mm/--spacing-y-mm/--marker-side-mm].
  • Studio Measure & Design: "Save printable mat (A4 SVG)…" button.
  • packlab_studio.spec bundles assets/calibration, so an installed Studio can find the mat file.

Honest limits

  • The report is always METRIC_UNVERIFIED / PHYSICAL_EVIDENCE_PENDING. A photo cannot see uniform or anisotropic print scaling. The homography absorbs most of a single misplaced marker: on synthetic A4 it leaves about 0.28 mm of residual per mm of shift, so only shifts above about 4 mm trip the 1 mm limit.
  • The tests use seeded synthetic renders of the real SVG with known homographies. They check the software math, not physical accuracy.
  • PL-0068 and PL-0220..PL-0224 physical gates are untouched. They still need a printed mat, an owner ruler record and a caliper benchmark.

Tests

  • tests/calibration/test_mat_photo_check.py: 7 passed
  • tests/studio/test_measure_design.py: new save-mat test passed
  • tests/calibration, tests/core/test_print_scale_sensitivity.py, tests/core/test_physical_accuracy_benchmark.py, tests/studio/test_measure_design.py, tests/ci/test_owner_dev_launcher_contract.py: 161 passed
  • tests/calibration, tests/packaging, tests/test_pytest_markers.py: 100 passed
  • tests/ci, tests/core/test_resource_paths.py, tests/studio/test_frozen_runtime.py: 48 passed
  • ruff check passed, mypy --no-incremental passed (353 files), ci_data_safety PASS

🤖 Generated with Claude Code

Sekiph82 and others added 5 commits December 4, 2026 02:45
…at asset

- packlab_core.calibration.mat_photo_check: detect the four AprilTag mat
  markers in one photo, fit the mat-mm -> px homography to all 16 corners,
  report corner residual (mm), mm/px at the mat centre and the owner ruler
  print gate; always METRIC_UNVERIFIED / PHYSICAL_EVIDENCE_PENDING. CLI
  (python -m ...) also exports the versioned printable SVG.
- Studio Measure & Design: "Save printable mat (A4 SVG)..." button.
- Frozen build bundles assets/calibration so the mat is reachable offline.
- Tests: seeded synthetic renders of the real A4/A3 SVG with known
  homographies (software math only, no physical claim).

PL-0068 and PL-0220..PL-0224 physical gates untouched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…us partial, counts unchanged)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ground truth, bundle check, SVG dialog)

F1 CLI exits 1 when the ruler gate is REJECTED_SCALING; F2 mm_per_px_at_mat_centre asserted against the true-homography Jacobian (rel 1e-2); F3 CLI exits 2 on PrintScaleSensitivityError; F4 failed_readings pinned; F5 per-size page corners; F6 static spec bundle assertion; F7 SVG filter and .svg suffix for the mat save dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Sekiph82
Sekiph82 merged commit 6b9ac61 into main Dec 4, 2026
2 checks passed
@Sekiph82
Sekiph82 deleted the feat/pl-0501-calibration-support branch December 4, 2026 00:25
Sekiph82 added a commit that referenced this pull request Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant